package com.eureka.provider.config;/*
 *@Description
 *@Author:Sam
 *@creat-time:2021/4/20 16:04
 */


import lombok.extern.slf4j.Slf4j;
import org.apache.curator.RetryPolicy;
//import org.apache.curator.framework.CuratorFramework;
//import org.apache.curator.framework.CuratorFrameworkFactory;
//import org.apache.curator.retry.ExponentialBackoffRetry;
//import org.apache.curator.retry.RetryNTimes;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.context.annotation.Bean;
//import org.springframework.stereotype.Service;
//
//@Service
//@Slf4j
//public class ZookeeperConfig implements ApplicationRunner {
//    @Autowired
//    CuratorFramework curatorClient;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        curatorClient.start();
//        log.info("zookeeper client start:"+zookeeperHost);
//    }
//
//    public String zookeeperHost="192.168.2.245:2181";
//
//    @Bean
//    public CuratorFramework curatorFramework(){
//        RetryPolicy retryPolicy=new ExponentialBackoffRetry(1000,3);
//        return CuratorFrameworkFactory.newClient(zookeeperHost,retryPolicy);
//    }
//}
